#include <iostream>

using namespace std;
const int N = 13;
int a[N];
int ret;
int main()
{
    for(int i = 1;i <= 10;i ++) cin >> a[i];
    int t; cin >> t;
    for(int i = 1;i <= 10;i ++)
    {
        if(a[i] <= t + 30) ret++;
    }
    cout << ret << endl;
    return 0;
}